using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class ChucNangMgt
	{
	
		public ResultObj SaveNewChucNang(ChucNang chucnang)
        		{
			ResultObj result = new ResultObj();
			chucnang.Id = -1;
			ChucNangDAO chucnangDAO = new ChucNangDAO();
			result = chucnangDAO.SaveChucNang(chucnang);
			
			return result;
		}
		
		public ResultObj UpdateChucNang(ChucNang chucnang)
        		{
			ResultObj result = new ResultObj();
			ChucNangDAO chucnangDAO = new ChucNangDAO();
			result = chucnangDAO.SaveChucNang(chucnang);
			
			return result;
		}
		
		public ResultObj DeleteChucNang(ChucNang chucnang)
        		{
			ResultObj result = new ResultObj();
			ChucNangDAO chucnangDAO = new ChucNangDAO();
			result = chucnangDAO.DeleteChucNang(chucnang);
			
			return result;
		}
		
		public ResultObj GetAllChucNang( )
        		{
			ResultObj result = new ResultObj();
			ChucNangDAO chucnangDAO = new ChucNangDAO();
			result = chucnangDAO.GetAllChucNang();
			
			return result;
		}
		
		public ResultObj GetChucNangById(ChucNang chucnang)
        		{
			ResultObj result = new ResultObj();
			ChucNangDAO chucnangDAO = new ChucNangDAO();
			result = chucnangDAO.GetAllChucNangByID(chucnang);
			
			return result;
		}
        
					
	}
}
